clear
%cd ('W:\Projects\Hoffmann_Shcherbakova\Programs_RES')
format('bank');

%%Table 3A 
display('     Table 3A: Robustness I - Industrial Structure')
display('               1964-1984')
display('row I')

 if ~exist('estimator')
     estimator='OLS';
 end
 if ~exist('channel')
     channel='all';
 end
 
state_group='all';
s=1;
T=21;
Main_preparation

M=[dy(s:s+T-1,1:K),(ones(T,1)*mean_mu75).*dy(s:s+T-1,1:K),(ones(T,1)*IndSpec(1,:)).*dy(s:s+T-1,1:K),ones(size(dgsp)),ones(T,1)*mean_mu75,ones(T,1)*IndSpec(1,:),trend];
NL=[];
channel='betaU';
Main

display('row II')
M=[dy(s:s+T-1,1:K),(ones(T,1)*mean_mu75).*dy(s:s+T-1,1:K),(ones(T,1)*IndSpec(2,:)).*dy(s:s+T-1,1:K),ones(size(dgsp)),ones(T,1)*mean_mu75,ones(T,1)*IndSpec(2,:),trend];
Main

display('row III')
estimator='GLS';
M=[dy(s:s+T-1,1:K),(ones(T,1)*mean_mu75).*dy(s:s+T-1,1:K),(ones(T,1)*IndSpec(1,:)).*dy(s:s+T-1,1:K),ones(size(dgsp)),ones(T,1)*mean_mu75,ones(T,1)*IndSpec(1,:),trend];
Main

display('row IV')
M=[dy(s:s+T-1,1:K),(ones(T,1)*mean_mu75).*dy(s:s+T-1,1:K),(ones(T,1)*IndSpec(2,:)).*dy(s:s+T-1,1:K),ones(size(dgsp)),ones(T,1)*mean_mu75,ones(T,1)*IndSpec(2,:),trend];
Main

display('================================================')
display('               1985-2005')
display('row V')
s=22;
T=42;
Main_preparation
estimator='OLS';
M=[dy(s:s+T-1,1:K),(ones(T,1)*mean_mu75).*dy(s:s+T-1,1:K),(ones(T,1)*IndSpec(1,:)).*dy(s:s+T-1,1:K),ones(size(dgsp)),ones(T,1)*mean_mu75,ones(T,1)*IndSpec(1,:),trend];
channel='betaU';
Main

display('row VI')
M=[dy(s:s+T-1,1:K),(ones(T,1)*mean_mu75).*dy(s:s+T-1,1:K),(ones(T,1)*IndSpec(2,:)).*dy(s:s+T-1,1:K),ones(size(dgsp)),ones(T,1)*mean_mu75,ones(T,1)*IndSpec(2,:),trend];
Main

display('row VII')
estimator='GLS';
M=[dy(s:s+T-1,1:K),(ones(T,1)*mean_mu75).*dy(s:s+T-1,1:K),(ones(T,1)*IndSpec(1,:)).*dy(s:s+T-1,1:K),ones(size(dgsp)),ones(T,1)*mean_mu75,ones(T,1)*IndSpec(1,:),trend];
Main

display('row VIII')
M=[dy(s:s+T-1,1:K),(ones(T,1)*mean_mu75).*dy(s:s+T-1,1:K),(ones(T,1)*IndSpec(2,:)).*dy(s:s+T-1,1:K),ones(size(dgsp)),ones(T,1)*mean_mu75,ones(T,1)*IndSpec(2,:),trend];
Main